package com.jihox.abookpro.domain;

import java.io.Serializable;
import java.util.Vector;

public class Book implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Vector<Page> pages = new Vector<Page>();
	private Page spine = null;
	private BookProduct product;
	private String templateName;
	
	public String getTemplateName() {
		return templateName;
	}

	public void setTemplateName(String templateName) {
		this.templateName = templateName;
	}

	public Book() {
	}

	public void setPages(Vector<Page> pages) {
		this.pages = pages;
	}

	public Vector<Page> getPages() {
		return pages;
	}

	public Vector<Page> getRegularPages() {
		if (pages == null || pages.isEmpty()) {
			return pages;
		} else {
			Vector<Page> result = new Vector<Page>();
			for (int i = 1; i < pages.size() - 1; i++) {
				result.add(pages.elementAt(i));
			}
			return result;
		}
	}

	public BookProduct getProduct() {
		return product;
	}

	public void setProduct(BookProduct product) {
		this.product = product;
	}

	public Page getSpine() {
		return spine;
	}

	public void setSpine(Page spine) {
		this.spine = spine;
	}
}
